def success_response(data=None, message="success"):
    """成功响应"""
    response = {
        "code": 200,
        "message": message
    }
    if data is not None:
        response["data"] = data
    return response

def error_response(message="error", code=400):
    """错误响应"""
    return {
        "code": code,
        "message": message
    } 